<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
	<link href="<c:url value="/css/addUser.css" />" rel="stylesheet">
	<script type="text/javascript" src="<c:url value="/js/user.js" />"></script>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>Insert title here</title>
</head>
<body>

	<form:form name="form" method="POST" command="User" action="updation" onsubmit="return doValidateForm()">

		<div id="errormsg"></div>
		<table>
			<tr>
				<td><form:hidden path="username" id="username" name="username"
						value="${user.username }" /></td>
			</tr>
			<tr>
				<td>First Name <span style="color: red">* </span> :
				</td>

				<td><form:input path="firstName" id="firstname"
						value="${user.firstName}" /></td>

			</tr>

			<tr>
				<td>Last Name <span style="color: red">* </span> :
				</td>

				<td><form:input path="lastName" id="lastname"
						value="${user.lastName}" /></td>

			</tr>

			<tr>
				<td>Email <span style="color: red">* </span> :
				</td>

				<td><form:input path="email" id="email" value="${user.email}" /></td>

			</tr>


			<tr>
				<td>Role <span style="color: red">* </span> :
				</td>

				<td><form:select path="role" id="role">

						<form:option value="${user.role}">${user.role}</form:option>

						<c:if test="${user.role ne 'manager'}">
							<form:option value="manager">Manager</form:option>
						</c:if>
						<c:if test="${user.role ne 'developer'}">
							<form:option value="developer">Developer</form:option>
						</c:if>

						<c:if test="${user.role ne 'tester'}">
							<form:option value="tester">Tester</form:option>
						</c:if>
					</form:select></td>

			</tr>

			<tr>
				<td><input type="submit" name="operation" class="button"
					value="Update" /></td>

				<td><input type="submit" name="operation" class="button"
					value="Delete" onclick="deleteForm()" /></td>

			</tr>
		</table>

	</form:form>
</body>
</html>